﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp8
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请选择你要运算的类型：1.加   2.减   3.乘   4.除");
            int key = Convert.ToInt32(Console.ReadLine());
            Calculate calculate;
            switch (key)
            {
                case 1:
                    Console.WriteLine("请输入第一个数：");
                    int Numone1 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("请输入第二个数：");
                    int Numtwo1 = Convert.ToInt32(Console.ReadLine());
                    calculate = new Jia(Numone1, Numtwo1, "+");
                    break;
                case 2:
                    Console.WriteLine("请输入第一个数：");
                    int Numone2 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("请输入第二个数：");
                    int Numtwo2 = Convert.ToInt32(Console.ReadLine());
                    calculate = new Jian(Numone2, Numtwo2, "-");
                    break;
                case 3:
                    Console.WriteLine("请输入第一个数：");
                    int Numone3 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("请输入第二个数：");
                    int Numtwo3 = Convert.ToInt32(Console.ReadLine());
                    calculate = new Cheng(Numone3, Numtwo3, "*");
                    break;
                case 4:
                    Console.WriteLine("请输入第一个数：");
                    int Numone4 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("请输入第二个数：");
                    int Numtwo4 = Convert.ToInt32(Console.ReadLine());
                    calculate = new Chu(Numone4, Numtwo4, "/");
                    break;
                default:
                    calculate = new Jia(0, 0, "+");
                    Console.WriteLine("你确实你没选择错？？？");
                    break;
            }
            PublicCalculate p = new PublicCalculate();
            p.PublicCalculatetest(calculate);
        }

    }
}
